stream = open(r'aa.txt', encoding="utf-8")
print(stream)
content = stream.read()
print(content)

stream.seek(0)
line = stream.readline()
print(line)

res = stream.readlines()
print(res)
for item in res:
    print(item.strip())

stream.close()

stream = open(r'aa.txt', mode="a", encoding="UTF-8")

msg = """
你好
  hello
   hi
    呦西
"""
stream.write(msg)
stream.close()